package com.guigu.qingcheng.controller;

import com.guigu.qingcheng.pojo.vo.TbCommentVo;
import com.guigu.qingcheng.service.TbCommentService;
import com.guigu.qingcheng.utils.PageUtil;
import com.guigu.qingcheng.utils.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

@Slf4j
@RestController
@RequestMapping("/comment")
@Api(tags = "TbCommentController")
public class TbCommentController {

    @Autowired
    private TbCommentService tbCommentService;

    @ApiOperation(value = "获取信息（list分页）带条件")
    @PostMapping("pageComment/{pageNum}/{pageSize}")
    public R pageComment(@RequestBody TbCommentVo commentVo, @PathVariable("pageNum") Integer pageNum, @PathVariable("pageSize") Integer pageSize){
        PageUtil<Map> pageUtils = tbCommentService.pageComment(commentVo, pageNum, pageSize);
        return R.ok().data("pageUtils",pageUtils);
    }
}
